package com.wolfden.drugserver.warping;

import java.io.Serializable;

import org.bukkit.Location;
import org.bukkit.Server;

public class SerializableLocation implements Serializable {

	private static final long serialVersionUID = 1963913222676345468L;

	private String world;
	private double x;
	private double y;
	private double z;
	private float yaw;
	private float pitch;

	public SerializableLocation(Location location) {

		super();
		this.world = location.getWorld().getName();
		this.x = location.getX();
		this.y = location.getY();
		this.z = location.getZ();
		this.yaw = location.getYaw();
		this.pitch = location.getPitch();
	}

	public Location getLocation(Server server) {

		return new Location(server.getWorld(world), x, y, z, yaw, pitch);
	}
}
